home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
EDITOR
/
AMAC44.ARJ
/
RFR009.QM
< prev
next >
Wrap
Text File
|
1992-05-27
|
33KB
|
750 lines
* rfr009.qm
* Macros To Sort and Convert Column Blocks
* Written By Tom Hogshead
* [ See RFRMxx.QM For Use ]
* 5/30/92
* New Key Macro
* Key Subfile Description Old Status
* ===== ============== ========================================== === ======
* Sort Column Block And Adjacent Text In:
* @1 --Ascending Absolute Value ( ) @f6
* @2 --Descending Absolute Value @f7
* @3 --Ascending, Case Insensitive @9
* @4 --Descending @f5
* @5 --Reverse @8
*
* Sort Column Block Only In:
* @6 --Ascending Absolute Value @5
* @7 --Descending Absolute Value @6
* @8 --Ascending, Limited to 999 Lines @0
* @9 --Descending @3
* @0 --Randomly @4
*
* Convert Column Blocks:
* #f1 --Make Column Block to Test Macros @f9
* #f2 --Test If Block Is Marked, and Close ^2
* #f3 --Convert Vertical to Horizontal Column Block
* #f4 --Convert Horizontal to Vertical Column Block
* #f5 --Convert Vertical to Horizontal Column Block,
* Horizontal Entries NOT Separated by Space
* #f6 --Convert Horizontal to Vertical Column Block,
* Horizontal Entries NOT Separated by Space
*
* {e:\up\RFRM*}--Return To RFRMxx.QM
*
*--eoi
* M A C R O S
* ----------------------------------------------------------------------
* @(1) Sort Column BLOCK And Adjacent Text In ASCENDING Absolute Value
* ----------------------------------------------------------------------
* This macro will sort an open or closed column block of entries and
* adjacent text in ascending absolute value (by ASCII #) and right
* justifies the sorted entries.
* Marking column 2 numbers as a column block:
* vvvv
* 2 This
* 2123 is
* 12 a
* 212 sort
* 1 test.
* Becomes this:
* 1 test.
* 2 This
* 12 a
* 212 sort
* 2123 is
@1 macrobegin
setscreenoff
editfile "nul" return quit gotoblockbeg jfalse END editfile return
copyblock gotoblockend cursorleft addline #173 cursorup
* -------------------------- Right justify --------------------------*
LOOP: unmarkblock markcolumn endline markcolumn
cut begline paste endline jtrue EMPTY gotoblockend
EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
unmarkblock markcolumn endfile cursorup markcolumn
* --------------------------- Sort ascend ---------------------------*
cut quit pasteover onewindow sort unmarkblock
END:
*
* 57 bytes Wed 01-15-1992 15:02:52 (TH @F6)
* 57 bytes Mon 04-20-1992 21:31:43 (TH @1)
* 57 bytes Mon 04-20-1992 21:52:58 (TH @1)
*
* ----------------------------------------------------------------------
* @(2) Sort Column BLOCK of Numbers And Adjacent Text
* In DESCENDING Absolute Value
* ----------------------------------------------------------------------
* This macro will sort an open or closed column block of numbers and
* adjacent text in DESCENDING absolute value (by ASCII #) and right
* justify the sorted numbers. Qconfig unkill buffer must be set to 1
* or more. ASCII #173 must not exist in lines being sorted. If you are
* not using QEdit v2.15, remove setscreenoff line.
* Marking column 2 numbers as a column block:
* vvvv
* 2 This
* 2123 is
* 12 a
* 212 sort
* 1 test.
* Becomes this:
* 2123 is
* 212 sort
* 12 a
* 2 This
* 1 test.
@2 macrobegin
setscreenoff
editfile "nul" return quit gotoblockbeg jfalse END editfile return
copyblock gotoblockend cursorleft addline #173 cursorup
* -------------------------- Right justify --------------------------*
LOOP: unmarkblock markcolumn endline markcolumn
cut begline paste endline jtrue EMPTY gotoblockend
EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
unmarkblock markcolumn endfile cursorup markcolumn
cut quit pasteover insertline #173 onewindow sort
* --------------------------- Sort descend ---------------------------*
AGAIN: gotoblockend jfalse MARK delline gotoblockbeg unkill jump AGAIN
MARK: find #173 return "b" return delline unmarkblock
makectrofscreen
END:
*
* 79 bytes Wed 01-15-1992 15:37:31 (TH @F7)
* 79 bytes Mon 04-20-1992 21:52:47 (TH @2)
*
*----------------------------------------------------------------
* @(3) Sort Column Block and Adjacent Text, Case Insensitive
*----------------------------------------------------------------
* This macro sorts a column block in ascending order and is case
* INSENSITIVE. We copy the sort key block, upper case it, and sort
* the copy. Then we delete the copy, leaving the original lines as
* they were, except sorted:
* Before After
* ======== =======
* abc 075
* DEF 186
* 970 275
* 877 345
* 710 421
* 615 520
* 520 615
* 421 710
* 345 877
* 275 970
* 186 abc
* 075 DEF
@3 macrobegin
setscreenoff * Remove if not using QEdit v2.15
onewindow gotoblockbeg
copyblock jfalse END
upper sort deleteblock
END:
*
* 13 bytes Mon 08-20-1990 07:17:25 (TH @9)
* 14 bytes Wed 12-11-1991 11:34:35 (TH @9, for v2.15)
* 14 bytes Mon 04-20-1992 21:38:52 (TH @3)
*
* ----------------------------------------------------------------------
* @(4) Sort Column Block and Adjacent Text In Descending Order, Fastest,
* Maximum Number of Lines Limited Only by Available Memory
* ----------------------------------------------------------------------
* This macro sorts an open or closed column block and all adjacent text
* in Descending order. The number of lines that can be sorted is
* limited only by the available memory.
* - Operates irrespective of all toggles and qconfig settings
* - Remove setscreenoff if you are not using QEdit v2.15
* - Block must be an open or closed column block
* - Will not sort line or character block
* - Will not sort if Kill Buffer set to unerase zero lines
* - Will "reverse" sort by removing "sort jfalse delmrk" (See @8)
* - Does not add extra blank line if block ends at eof
* - ASCII #173 must not exist in sort block
* - Macro ends with cursor at block begin
* Marking column 2 numbers as a column block:
* vvvv
* 2123 is
* 212 sort
* 2 This
* 12 a
* 1 test.
* Becomes this:
* 2123 is
* 212 sort
* 2 This
* 12 a
* 1 test.
@4 macrobegin
setscreenoff * Remove if not using QEdit v2.15
horizontalwindow
editfile escape * For all Qconfig's *|5
prevwindow * Close block if open
onewindow * Need for sort
gotoblockbeg jfalse end * End macro if no block marked
insertline *ELSE insert line for pos marker
delline unkill jfalse end * Test if unkill buff set >0,
* may remove line if unkill set >0
#173 * Insert pos marker at block beg
sort * Sort ascending
jfalse delmark * If we can't sort, must not be a
* column block, del marker and end
* gotoblockend addline * Need for blk that ends at eof*|1
again:
gotoblockend jfalse delblnk * End macro when no more block
delline *ELSE delete next line
gotoblockbeg unkill * Unerase line at block beg
jump again * Loop 'till done
delblnk:
* cursordown delline * Delete extra blank line *|2
cursordown * Test if block ended at eof *|3
cursordown jtrue delmark delline * Delete blank line if at eof *|4
delmark:
find #173 return "b" return delline * Delete pos marker line
end:
unmarkblock * In case no marked column block
*
* 46 bytes Sun 12-15-1991 17:07:51 (TH @F4, to MH #22/4282)
* 49 bytes Mon 12-16-1991 11:24:07 (TH @F5, rplc 1,2 w/3,4 for speed)
* 49 bytes Mon 12-16-1991 11:24:07 (TH @F5, to MH #22/4304)
* 49 bytes Mon 04-20-1992 21:35:17 (TH @F5)
* 49 bytes Mon 04-20-1992 21:35:27 (TH @4)
* 49 bytes Mon 04-20-1992 21:56:42 (TH @4)
* 51 bytes Wed 05-13-1992 12:54:07 (TH @4, for all Qconfig's *|5)
*
* ---------------------------------------------------------------
* @(5) Sort Column Block and Adjacent Text in Reverse Order,
* Maximum Number of Lines Limited Only by Available Memory
* ---------------------------------------------------------------
* This macro sorts a column block and text adjacent to the column block
* in REVERSE order, not DESCENDING like @7, i.e. The last column entry
* becomes the first, and so on. @5 has the same effect on text
* adjacent to the column block as 'sort'. Results are the same as if
* the column block was an inverted one dimmensional matrix.
* Before After
* ======== =======
* 075 abc
* 186 DEF
* 275 970
* 345 877
* 421 710
* 520 615
* 615 520
* 710 421
* 877 345
* 970 275
* DEF 186
* abc 075
@5 macrobegin
setscreenoff * Remove if not using QEdit v2.15
horizontalwindow * Close block if open
editfile escape * For all Qconfig's *|
onewindow * Need for sort
gotoblockbeg jfalse end * End macro if no block marked
insertline * Insert line for pos marker
delline unkill jfalse end *ELSE test if unkill buff set >0
#173 * Insert pos marker at block beg
again:
gotoblockend jfalse testeof * End macro when no more block
delline *ELSE delete next line
gotoblockbeg unkill * Unerase line at block beg
jump again * Loop 'till done
testeof:
cursordown cursordown jtrue delmark * Test if block ended at eof
delline *ELSE delete extra blank line
delmark:
find #173 return "b" return delline * Delete pos marker line
end:
unmarkblock * In case no block marked
*
* 43 bytes Sun 08-25-1991 17:23:40 (TH @8)
* 52 bytes Mon 09-16-1991 22:20:14 (TH @8, for all Qconfig's)
* 55 bytes Wed 12-11-1991 12:50:27 (TH @8, corrected for #'s in col 1)
* 52 bytes Sat 12-14-1991 13:07:00 (TH @F4)
* 48 bytes Sun 12-15-1991 10:53:10 (TH @8, used better alogrithm)
* 44 bytes Mon 12-16-1991 11:33:03 (TH @8, like @F4 w/o first sort)
* 44 bytes Mon 04-20-1992 21:39:55 (TH @5)
* 46 bytes Wed 05-13-1992 12:57:30 (TH @5, for all Qconfig's)
*
* ----------------------------------------------------------------------------
* @(6) Sort Column Block Only In Ascending Absolute Value,
* Adjacent Text Unchanged
* ----------------------------------------------------------------------------
* This macro sorts an open or closed column block of entries in
* ascending absolute value (by ASCII #) and right justies the sorted
* entries. Will only sort single column, no adjacent text.
* Marking numbers as a column block:
* vvvv
* 2 This
* 2123 is
* 12 a
* 212 sort
* 1 test.
* Becomes this:
* 1 This
* 2 is
* 12 a
* 212 sort
* 2123 test.
@6 macrobegin
setscreenoff
editfile "nul" return quit gotoblockbeg jfalse END editfile return
copyblock gotoblockend cursorleft addline #173 cursorup
LOOP: unmarkblock markcolumn endline markcolumn
cut begline paste endline jtrue EMPTY gotoblockend
EMPTY: cursorleft cursorup jtrue LOOP begfile cursorright
unmarkblock markcolumn endfile cursorup markcolumn
onewindow sort cut quit pasteover unmarkblock
END:
*
* 47 bytes Sun 12-08-1991 12:00:16 (TH @2, to EW as @6 #20/24)
* 57 bytes Tue 12-10-1991 13:40:16 (TH @5, made block para)
* 56 bytes Tue 12-10-1991 22:00:34 (TH @5, changed to backspace)
* 56 bytes Tue 12-10-1991 22:00:34 (TH @5, to EW #20/191, 1/13)
* 55 bytes Tue 01-14-1992 17:45:47 (TH @5, handle blocks w/empty lines)
* 55 bytes Tue 01-14-1992 17:45:47 (TH @5, to EW #20/198)
* 56 bytes Tue 01-14-1992 20:20:44 (TH @5, to EW #20/199)
* 57 bytes Wed 01-15-1992 22:22:28 (TH @5, added onewindow)
* 57 bytes Tue 04-21-1992 10:50:44 (TH @6)
*
* ----------------------------------------------------------------------
* @(7) Sort Only Column BLOCK of Numbers In DESCENDING Absolute Value
* ----------------------------------------------------------------------
* This macro will sort an open or closed column block of numbers in
* DESCENDING absolute value (by ASCII #) and right justify the sorted
* numbers. Will only sort single column, no adjacent text. If you are
* not using QEdit v2.15, remove setscreenoff line.
* Marking column 2 numbers as a column block:
* vvvv
* 2 This
* 2123 is
* 12 a
* 212 sort
* 1 test.
* Becomes this:
* 2123 This
* 212 is
* 12 a
* 2 sort
* 1 test.
@7 macrobegin
setscreenoff
editfile "nul" return quit gotoblockbeg jfalse END editfile return
copyblock gotoblockend cursorleft addline #173 cursorup
* -------------------------- Right justify --------------------------*
LOOP: unmarkblock markcolumn endline markcolumn
cut begline paste endline jtrue EMPTY gotoblockend
EMPTY: cursorleft cursorup jtrue LOOP
begfile markcolumn endfile cursorup markcolumn
* --------------------------- Sort descend ---------------------------*
onewindow sort
AGAIN: gotoblockend jfalse CONT delline gotoblockbeg unkill jump AGAIN
CONT: cursorleft markcolumn begfile cursorright
cut quit pasteover
END: unmarkblock
*
* 105 bytes Tue 12-10-1991 13:41:19 (TH @6, made block para)
* 104 bytes Tue 12-10-1991 22:01:02 (TH @6, changed to backspace)
* 104 bytes Sun 12-15-1991 11:31:11 (TH @6, better algorithm)
* 104 bytes Sun 12-15-1991 11:31:11 (TH @6, to EW #20/191, 1/13)
* 67 bytes Tue 01-14-1992 18:25:19 (TH @6, handle blocks w/empty lines)
* 67 bytes Tue 01-14-1992 18:25:19 (TH @6, to EW #20/198)
* 68 bytes Tue 01-14-1992 20:18:12 (TH @6, to EW #20/199)
* 69 bytes Wed 01-15-1992 17:30:54 (TH @6, added onewindow)
* 69 bytes Tue 04-21-1992 10:51:24 (TH @7)
*
* ----------------------------------------------------------------------
* @(8) Sort Column Block Only In Ascending Order, Adjacent Text Unchanged
* ----------------------------------------------------------------------
* This macro sorts only the entries in an open or closed column block
* in ascending order, leaving all text surrounding the column block in
* the same position before and after.
@8 macrobegin
setscreenoff
editfile "nul" return quit gotoblockbeg jfalse END editfile return
moveblock onewindow sort cut quit paste unmarkblock
END:
*
* 27 bytes Thu 01-16-1992 09:25:43 (TH @0)
* 27 bytes Tue 04-21-1992 10:55:22 (TH @8)
* Marking numbers as a column block:
* vvvv
* 2 This
* 2123 is
* 12 a
* 212 sort
* 1 test.
* Becomes this:
* 1 This
* 12 is
* 2 a
* 212 sort
* 2123 test.
*
* ----------------------------------------------------------------------
* @(9) Sort Column Block Only In Descending Order, Adjacent Text Unchanged
* ----------------------------------------------------------------------
* This macro sorts only the entries in an open or closed column block
* in descending order. It leaves all text surrounding the column block
* in the same position before and after.
* Marking column 2 numbers as a column block:
* vvvv
* 2 This
* 2123 is
* 12 a
* 212 sort
* 1 test.
* Becomes this:
* 2123 This
* 212 is
* 2 a
* 12 sort
* 1 test.
@9 macrobegin
setscreenoff * Remove if not using QEdit v2.15
OneWindow
EditFile "NUL" Return Quit GoToBlockBeg JFalse ENDSORT
EditFile Return
MoveBlock
*--- Reverse sort block only
Sort
again:
gotoblockend jfalse cont * End macro when no more block
delline *ELSE delete next line
gotoblockbeg unkill * Unerase line at block beg
jump again * Loop 'till done
cont:
*--- Make column block of widest entry
begfile
1: endline
2: cursorleft markcolumn cursordown jfalse 4
3: jump 1
4: delline
Cut Quit Paste unmarkblock
ENDSORT:
*
* 43 bytes Thu 08-15-1991 12:42:05 (TH @3)
* 48 bytes Wed 12-11-1991 12:27:52 (TH @3, for all qconfig's)
* 49 bytes Sun 12-15-1991 11:05:35 (TH @3, better algorithm)
* 49 bytes Tue 04-21-1992 10:56:20 (TH @9)
*
* ----------------------------------------------------------------------
* @(0) Randomly Sort a Column Block of Up to 999 Entries
* ----------------------------------------------------------------------
* To run, mark a column block to be randomly sorted, either open or
* closed. This macro will randomly sort up to 999 entries in a column
* block and leave the text adjacent to the column block in it's
* original position. The results are the same as randomly sorting a
* one dimmensional matrix composed of entries in the column block.
* A file named $rand containing numbers 1 to 999 randomly sorted is used
* as the sorting key. A temporary block containing both the block to
* be sorted adjacent to the random numbers is sorted using the random
* numbers as the sort key. Thus, sorting the random numbers into an
* ascending sorted set sorts the original marked block into a random
* set.
* The file $rand must be present in the current directory and is
* included in AMACxx.ZIp. If $rand does not exist, it can easily be
* made by first removing the asterisks and spaces in col 1 in the table
* below, formatting the 999 random sorted numbers to a right margin
* width of 4, and then saving the single column formatted numbers to a
* file named $rand.
* As an example, col 1 when marked as an open or closed column block,
* becomes randomly sorted as shown in col 2:
* Before After
* ======== =======
* 075 877
* 186 abc
* 275 275
* 345 970
* 421 345
* 520 615
* 615 075
* 710 710
* 877 186
* 970 421
* abc DEF
* DEF 520
@0 macrobegin
setscreenoff * Remove if not using QEdit v2.15
onewindow
gotoblockbeg jtrue 1 markcolumn * Close block *|
gotoblockbeg jtrue END
1: editfile "$rand" return * Load random number file
begfile endline cursorright * Position for block
moveblock * Move unsorted
gotoblockend unmarkblock
cursorleft markcolumn begfile * Get random #'s in block
sort * Sort with random number key
wordright splitline endline * Remove random #'s from block *|
cursorright joinline * *|
cut quit * Cut block to scrap, quit RAND*|
paste * Paste random block back
unmarkblock
END:
*
* 33 bytes Sun 08-25-1991 13:52:16 (TH @4)
* 46 bytes Fri 12-13-1991 10:16:12 (TH @4, quit if no block, quit $rand |)
* 46 bytes Tue 04-21-1992 10:57:02 (TH @0)
* Numbers 001 to 999 Randomly Sorted
* ---------------------------------
* This table contains numbers 001 to 999 randomly sorted. Statisticians
* will argue this is not 'truly random' and it is not but it is
* sufficiently random for our column block sorting purposes. There are
* no repeating numbers. This Table is included as a single column file
* $rand in AMACxx.ZIP.
* 487 671 332 471 727 897 478 551 054 371 080 856 987 821 634 338 937
* 614 562 020 171 932 705 601 274 791 824 477 663 552 343 223 288 654
* 273 205 945 480 317 533 903 685 740 725 187 017 722 560 530 842 087
* 777 192 142 452 319 523 208 181 732 704 126 218 014 568 672 780 809
* 517 033 365 940 883 430 024 215 750 426 380 347 774 606 314 433 009
* 377 869 359 836 595 876 963 456 715 929 060 015 658 861 481 773 095
* 799 674 217 212 182 984 018 804 174 151 993 771 520 335 778 386 388
* 858 287 695 465 684 593 522 008 488 123 930 240 119 692 531 267 730
* 437 483 406 472 770 188 742 516 027 905 264 250 807 374 494 915 969
* 967 454 259 137 550 859 589 245 447 213 741 953 958 270 926 957 230
* 952 475 801 868 253 285 921 466 702 130 204 302 819 041 237 282 016
* 207 911 640 418 754 244 308 559 175 114 738 525 792 584 173 553 510
* 950 147 720 779 894 539 977 994 597 411 030 068 665 912 655 689 604
* 822 872 052 443 312 354 440 962 736 546 249 996 986 337 716 034 512
* 134 760 942 381 504 895 128 301 339 619 113 368 825 916 358 254 395
* 690 403 133 966 563 749 390 954 216 242 132 913 664 333 980 726 050
* 112 315 307 449 693 622 806 349 476 887 227 631 382 823 366 444 698
* 796 263 839 350 091 362 446 906 324 460 526 295 814 651 904 461 143
* 981 659 458 177 850 002 805 121 591 127 412 345 222 029 931 110 457
* 224 759 498 751 877 473 746 888 391 555 202 252 363 794 923 387 389
* 509 629 649 164 956 357 160 865 524 628 998 209 180 396 818 681 084
* 815 062 728 739 378 648 505 450 265 623 933 656 206 427 320 574 423
* 492 612 990 666 064 239 178 679 639 183 144 025 844 766 299 556 860
* 616 328 569 641 225 790 266 318 469 573 135 019 441 094 784 892 290
* 321 118 072 511 697 831 808 482 834 548 734 896 420 083 012 590 294
* 322 499 158 811 057 161 786 587 783 146 709 820 832 576 975 733 234
* 255 131 501 810 917 537 138 214 246 982 257 286 088 907 099 355 645
* 624 884 919 846 141 085 793 829 098 409 870 513 694 346 802 109 296
* 617 199 944 714 721 081 871 642 003 683 341 262 280 719 021 983 788
* 878 627 150 102 168 899 464 490 758 922 495 845 946 797 528 397 048
* 067 547 544 340 231 163 170 585 660 854 691 961 139 069 269 789 900
* 518 474 542 575 445 186 889 647 763 169 947 997 298 036 424 063 047
* 251 326 610 643 848 491 276 948 497 538 626 361 309 379 195 633 172
* 713 696 880 106 743 535 260 093 570 400 277 529 289 035 621 484 976
* 191 717 241 800 369 652 124 837 179 413 653 891 762 583 637 198 686
* 767 097 795 292 011 090 376 197 416 885 890 586 306 554 031 037 782
* 863 038 108 840 404 600 724 785 851 422 079 572 442 991 699 949 185
* 051 879 372 284 744 828 712 925 271 383 941 053 951 753 056 431 414
* 233 023 066 293 935 167 272 703 417 010 602 247 909 070 210 965 875
* 155 873 125 992 765 467 657 162 673 960 248 042 370 032 669 615 351
* 618 902 221 843 635 103 540 502 830 157 152 236 256 219 752 040 866
* 228 410 082 421 775 995 356 489 508 959 943 235 914 434 089 327 541
* 360 493 781 156 661 076 682 934 189 149 352 813 166 936 567 978 988
* 565 577 107 367 708 670 353 867 620 927 968 462 769 407 013 459 761
* 201 920 373 688 862 402 608 316 527 772 707 855 632 939 148 581 325
* 086 438 841 566 435 159 348 874 297 448 549 045 220 268 261 344 519
* 468 078 129 756 401 005 607 331 073 419 184 096 582 545 405 729 100
* 432 817 757 677 985 668 609 190 532 194 826 594 058 833 755 710 071
* 979 881 864 662 028 893 193 092 342 507 625 238 074 882 075 455 588
* 394 592 313 375 646 852 229 105 748 723 278 803 334 485 007 111 415
* 731 598 506 928 989 711 910 291 596 901 580 898 768 700 678 203 500
* 451 605 453 153 077 044 835 515 104 004 279 776 065 305 470 999 561
* 857 101 258 399 364 243 816 039 955 329 061 116 310 908 747 043 281
* 336 384 603 972 964 463 571 644 630 226 543 049 650 970 745 787 847
* 176 115 924 812 001 534 687 122 503 667 232 735 304 579 154 398 557
* 886 022 638 680 436 496 145 675 385 006 578 564 392 486 439 059 283
* 211 737 849 429 974 971 136 514 200 718 558 536 599 165 300 701 140
* 117 120 973 838 393 026 613 764 479 196 827 275 408 046 425 706 611
* 311 676 055 918 303 323 938 428 330 636 521 853 798
*
* ----------------------------------------------------------------------
* #(f1) Make Column Block to Test Macros
* ----------------------------------------------------------------------
* This is a macro to test the sorting macros. Be sure there are at
* least 6 blank lines to insert the marked column block. Qconfig must
* be set to shift blocks with Tab. This macro inserts the following:
* Marked
* vvv
* A BB
* b aa
* C 1
* d 385
* E 173
* ^^^
#f1 macrobegin
delline delline delline delline delline delline
"A BB" return "b aa" return "C 1" return "d 385" return "E 173" return
return prevpara unmarkblock markline endpara markline
prevpara begline wordright wordright tabrt
unmarkblock firstnonwhite wordright
markcolumn cursordown cursordown cursordown cursordown
cursorright cursorright markcolumn gotoblockbeg
*
* 80 bytes Wed 12-11-1991 16:06:05 (TH @F9)
* 80 bytes Tue 04-21-1992 11:06:17 (TH #f1)
*
* ----------------------------------------------------------------------
* #(f2) Technique to Test If Block Is Marked, and Close Block
* ----------------------------------------------------------------------
* This technique is a short quick way to to test if block is marked,
* and close the block if it is open.
#f2 macrobegin
horizontalwindow
editfile escape * For all Qconfig's *|
prevwindow onewindow
gotoblockbeg jfalse END
* <<< PROCESS BLOCK >>>
END:
*
* 11 bytes Mon 12-30-1991 11:36:56 (TH ^2)
* 11 bytes Tue 04-21-1992 12:19:21 (TH #f2)
* 13 bytes Wed 05-13-1992 12:58:54 (TH #f2, for all Qconfig's)
*
* ----------------------------------------------------------------------
* #(f3) Convert Vertical to Horizontal Column Block,
* Horizontal Entries Separated by a Single Space
* ----------------------------------------------------------------------
* This macro converts a vertical column block to a horizontal single
* line column block with horizontal entries separated by a single
* space. Block may be open or closed.
* 1 becomes 1 2 3
* 2
* 3
#F3 MacroBegin
OneWindow EditFile "NUL" Return Quit GotoBlockBeg jfalse END
HorizontalWindow EditFile Return MoveBlock
LOOP: EndLine
CursorRight CursorRight JoinLine CursorLeft DelRtWord jtrue LOOP
EndLine MarkCharacter Cut Quit PrevWindow OneWindow Paste
END: * UnmarkBlock
*
* 38 bytes Thu 08-15-1991 15:35:40 (TH #F3)
*
* ----------------------------------------------------------------------
* #(f4) Convert Horizontal to Vertical Column Block,
* Horizontal Entries Separated by Space
* ----------------------------------------------------------------------
* This macro converts a horizontal single line column block, with
* horizontal entries separated by a single space, to a vertical column
* block. Block may be open or closed.
* 1 2 3 becomes 1
* 2
* 3
#F4 MacroBegin
OneWindow AltWordSet EditFile "NUL" Return
Quit GotoBlockBeg jfalse END
HorizontalWindow EditFile Return MoveBlock UnmarkBlock WordRight
LOOP: EndLine Jfalse NEXT
PrevPosition CursorLeft DelCh SplitLine WordRight WordRight jump LOOP
NEXT: CursorLeft MarkColumn BegFile Cut Quit PrevWindow OneWindow Paste
END: DefaultWordSet * UnmarkBlock
*
* 47 bytes Thu 08-15-1991 15:36:00 (TH #F4)
*
* ----------------------------------------------------------------------
* #(f5) Convert Vertical to Horizontal Column Block,
* Horizontal Entries NOT Separated by a Single Space
* ----------------------------------------------------------------------
* This macro converts a vertical column block to a horizontal single
* line column block with horizontal entries NOT separated by a single
* space. Block may be open or closed.
* 1 becomes 123
* 2
* 3
#F5 MacroBegin
OneWindow EditFile "NUL" Return Quit GotoBlockBeg jfalse END
HorizontalWindow EditFile Return MoveBlock
LOOP: EndLine JoinLine jtrue LOOP
EndLine MarkCharacter Cut Quit PrevWindow OneWindow Paste
END: * UnmarkBlock
*
* 34 bytes Thu 08-15-1991 15:39:00 (TH #F5)
*
* ----------------------------------------------------------------------
* #(f6) Convert Horizontal to Vertical Column Block,
* Horizontal Entries NOT Separated by Space
* ----------------------------------------------------------------------
* This macro converts a horizontal single line column block, with
* horizontal entries NOT separated by a single space, to a vertical
* column block. Block may be open or closed.
* 123 becomes 1
* 2
* 3
#F6 MacroBegin
OneWindow EditFile "NUL" Return Quit GotoBlockBeg jfalse END
HorizontalWindow EditFile Return MoveBlock UnmarkBlock
LOOP: CursorRight SplitLine Begline CursorDown EndLine Jfalse NEXT
PrevPosition jump LOOP
NEXT: CursorUp BegLine MarkColumn BegFile Cut Quit PrevWindow OneWindow
Paste
END: * UnmarkBlock
*
* 44 bytes Thu 08-15-1991 15:40:21 (TH #F6)